﻿<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>用户管理</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css" />
    <link rel="stylesheet" href="../../assets/module/admin.css?v=314" />
    <link rel="stylesheet" href="../../assets/css/publicStyle.css">
    <link rel="stylesheet" href="../../assets/libs/ztree/css/zTreeStyle/zTreeStyle.css">
    <!--[if lt IE 9]>
    <script src="../../assets/libs/html5shiv.min.js"></script>
    <script src="../../assets/libs/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-fluid>.layui-card {
            height: calc(100vh - 30px);
            overflow: auto;
        }

        #page-box {
            display: inline;
            float: right;
        }

        #page-box .layui-laypage {
            margin: 0;
        }
    </style>
</head>

<body>

    <!-- 页面加载loading -->
    <div class="page-loading">
        <div class="ball-loader">
            <span></span><span></span><span></span><span></span>
        </div>
    </div>

    <!-- 正文开始 -->
    <div class="layui-fluid">
        <div class="layui-card">
            <div class="layui-card-body table-tool-mini">
                <div class="layui-form toolbar">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <div class="layui-input-inline mr0">
                                <input name="username" class="layui-input" type="text" placeholder="输入用户名" />
                            </div>
                        </div>
                        <div class="layui-inline" style="padding-right: 110px;">
                            <button class="layui-btn icon-btn layui-btn-sm" lay-filter="formSubSearchUser" lay-submit>
                                <i class="layui-icon">&#xe615;</i>搜索
                            </button>
                            <button id="btnAddUser" class="layui-btn icon-btn layui-btn-sm"><i
                                    class="layui-icon">&#xe654;</i>添加</button>
                            <button id="btnRefreshUser" class="layui-btn icon-btn layui-btn-sm"><i
                                    class="layui-icon">&#xe669;</i>刷新</button>
                        </div>
                        <div id="page-box"></div>

                    </div>
                </div>

                <table class="layui-table" id="tableUser" lay-filter="tableUser"></table>
            </div>
        </div>
    </div>

    <!-- 表格操作列 -->
    <script type="text/html" id="tableBarUser">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

    <script id="role-tpl" type="text/html">
    {{each data}}
    <input type="checkbox" name='role{{$value.roleId}}' value='{{$value.roleId}}' title='{{$value.roleName}}' lay-skin="primary">
    {{/each}}
</script>

    <script id="adduser-role-tpl" type="text/html">
    {{each data}}
    <input type="checkbox" name='role{{$value.roleId}}' value='{{$value.roleId}}' title='{{$value.roleName}}' lay-skin="primary">
    {{/each}}
</script>
    <style>
        .user_content {
            min-height: 200px;
            max-height: 300px;
            overflow-x: hidden;
            overflow-y: auto;
            margin-bottom: 40px;
        }
        #add-RoleName-box{
            display: flex;
            flex-direction: column;
        }
        #roleName-box{
            display: flex;
            flex-direction: column;
        }
    </style>
    <!-- 表单弹窗 -->
    <script type="text/html" id="modelUser">
    <form id="modelUserForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input name="username" placeholder="请输入用户名" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required disabled/>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-block">
                <input name="mobile" placeholder="请输入用户名" type="text" class="layui-input" maxlength="11"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                <input type="radio" name="delFlag" value="0" title="有效" checked/>
                <input type="radio" name="delFlag" value="1" title="无效"/>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block" style="margin-left: 52px">
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">角色</li>
                        <li>组织</li>
                        <li>区划</li>
                    </ul>
                    <div class="layui-tab-content user_content">
                        <div class="layui-tab-item layui-show">
                            <div id="roleName-box"></div>
                        </div>
                        <div class="layui-tab-item">
                            <div id="roleMenuTree" class="ztree"></div>
                        </div>
                        <div class="layui-tab-item">
                            <div class="region_select" style="width:180px">
                                <select name="regionVersion" id="regionVersion" lay-verify="" lay-filter="regionVersion"></select>
                            </div>
                            <div class="region_select" style="width:182px;margin-top: 4px">
                                <input name="regionRcode" placeholder="当前区划代码" disabled type="text" class="layui-input" maxlength="11"
                                       lay-verType="tips" />
                            </div>

                            <div id="region_tree" class="ztree"></div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
</script>

    <script type="text/html" id="addUserModel">
    <form id="addUserModelForm" lay-filter="modelUserForm" class="layui-form model-form">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input name="username" placeholder="请输入用户名" type="text" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码</label>
            <div class="layui-input-block">
                <input name="password" placeholder="请输入密码" type="password" class="layui-input" maxlength="20"
                       lay-verType="tips" lay-verify="required" required/>
            </div>
        </div>
        <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-block">
                    <input name="mobile" placeholder="请输入手机号" type="text" class="layui-input" maxlength="11"
                           lay-verType="tips" lay-verify="required" required/>
                </div>
            </div>
        <div class="layui-form-item">
                <div class="layui-input-block" style="margin-left: 52px">
                    <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                        <ul class="layui-tab-title">
                            <li class="layui-this">角色</li>
                            <li>组织</li>
                            <li>区划</li>
                        </ul>
                        <div class="layui-tab-content user_content">
                            <div class="layui-tab-item layui-show">
                                    <div id="add-RoleName-box"></div>
                            </div>
                            <div class="layui-tab-item">
                                    <div id="roleMenuTree" class="ztree"></div>
                            </div>
                            <div class="layui-tab-item">
                                <div class="region_select" style="width:180px">
                                    <select name="regionVersion" id="regionVersion" lay-verify="" lay-filter="regionVersion"></select>
                                </div>
                                <div id="region_tree" class="ztree"></div>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closePageDialog">取消</button>
            <button class="layui-btn" lay-filter="modelSubmitUser" lay-submit>确定</button>
        </div>
    </form>
    </script>
     <!-- 渲染版本 -->
    <script type="text/tmpl" id="template-version-tmpl">
        <option value="">请选择区划版本</option>
         {{each regionCatalogType}}
            <option value="{{$value.id}}">{{$value.name}}</option>
        {{/each}}
    </script>
    <!-- js部分 -->
    <script type="text/javascript" src="../../assets/libs/layui/layui.js"></script>
    <script type="text/javascript" src="../../assets/js/common.js?v=314"></script>
    <script src="../../assets/libs/jquery/jquery-3.2.1.min.js"></script>
    <!-- Ztree树部分 -->
    <script src="../../assets/libs/ztree/js/jquery.ztree.core.min.js"></script>
    <script src="../../assets/libs/ztree/js/jquery.ztree.exedit.js"></script>
    <script src="../../assets/libs/ztree/js/jquery.ztree.excheck.min.js"></script>
    <script src="../../assets/libs/template-web.js"></script>
    <script src="../../assets/libs/axios.min.js"></script>
    <script src="../../assets/js/config.js"></script>
    <script src="../../assets/js/authority.js"></script>
    <script src="../../assets/js/config/region.js"></script>
    <script src="../../assets/js/system/user.js"></script>
</body>

</html>